<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:oso="http://osoftware.com/facelets" template="/WEB-INF/templates/mainSearchLayout.xhtml">

	<ui:define name="title">
		<h:outputText value="#{resourceBundle['patient.title']}" />
	</ui:define>

	<ui:define name="searchFields">
		<oso:inputText id="firstNameFilter" label="#{resourceBundle['patient.firstName']}" value="#{patientModel.filter.firstName}" />
		<oso:inputText id="lastNameFilter" label="#{resourceBundle['patient.lastName']}" value="#{patientModel.filter.lastName}" />
		<oso:selectOneMenu id="prepaidFilter" label="#{resourceBundle['patient.prepaids']}" value="#{patientModel.filter.prepaid}" converter="prepaidConverter" items="#{patientModel.selectablePrepaids}"
			itemLabel="name">
		</oso:selectOneMenu>
		<oso:selectOneMenu id="specialistFilter" label="#{resourceBundle['patient.specialist']}" value="#{patientModel.filter.specialist}" converter="specialistConverter"
			items="#{patientModel.selectableSpecialists}" itemLabel="fullName">
		</oso:selectOneMenu>
	</ui:define>

	<ui:define name="listValues">
		<ui:param name="listModel" value="#{patientModel.list}" />
		<ui:param name="targetObject" value="#{patientModel.editedEntity}" />
	</ui:define>

	<ui:define name="searchColumns">
		<p:column sortBy="#{row.documentType}" style="width:50px;">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['patient.documentType']}" />
			</f:facet>
			<h:outputText value="#{row.documentType}" />
		</p:column>

		<p:column sortBy="#{row.documentNumber}" style="width:50px;">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['patient.documentNumber']}" />
			</f:facet>
			<h:outputText value="#{row.documentNumber}" />
		</p:column>

		<p:column sortBy="#{row.lastName}">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['patient.lastName']}" />
			</f:facet>
			<h:outputText value="#{row.lastName}" />
		</p:column>

		<p:column sortBy="#{row.firstName}">
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['patient.firstName']}" />
			</f:facet>
			<h:outputText value="#{row.firstName}" />
		</p:column>

		<p:column>
			<f:facet name="header">
				<h:outputText value="#{resourceBundle['patient.prepaids']}" />
			</f:facet>
				<h:outputText value="#{patientModel.generatePrintablePrepaids(row.prepaids)} " />
		</p:column>

	</ui:define>
</ui:composition>